<template>
	<view class="box">
		<SubTitle :title="title" label="更多" icon="../../static/icon/right.svg" :showline="true" @send="go()" />
		<view class="box-item">
			<view class="col-6" v-for="(item,index) in list" @click="videoDetail(item.id)">
				<image class="box-item-image" :src="item.coverUrl" mode="aspectFill" lazy-load="true">
					<view class="title">
						{{item.title}}
					</view>
				</image>
			</view>
		</view>
	</view>
</template>

<script>
	import SubTitle from './SubTitle.vue'
	export default {
		components: {
			SubTitle
		},
		props: {
			// 瀑布流列表
			list: {
				type: Array
			},
			title: {
				type: String
			}
		},
		data() {
			return {}
		},
		methods: {
			videoDetail(id) {
				uni.navigateTo({
					url: '/pages/home/VideoDetail/VideoDetail?id=' + id
				});
			}
		}
	}
</script>

<style scoped>
	.box {
		display: flex;
		flex-direction: column;
		flex-wrap: wrap;
		justify-content: space-around;
		margin-bottom: 50rpx;
	}

	.box-item {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
	}

	.col-6 {
		overflow: hidden;
		position: relative;
		width: 50%;
		height: 200rpx;
		box-sizing: border-box;
		padding: 10rpx;
	}
	
	.box-item-image {
		position: relative;
		width: 100%;
		height: 100%;
		overflow: hidden;
		border-radius: 10rpx;
	}

	.title {
		position: absolute;
		bottom: 0;
		left: 10rpx;
		padding: 12rpx;
		width: 30%;
		text-indent: 2rpx;
		opacity: 0.5;
		font-weight: 400;
		background-color: #ccc;
	}
</style>